package com.trailwalker.traceability.net.client.api;

import com.trailwalker.traceability.entitiy.body.*;
import com.trailwalker.traceability.net.result.ApiResult;
import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.*;

public interface DataSourceApi {

    /**
     * 注册
     *
     * @param accountRequestBody
     * @return
     */
    @Headers({
            "needToken:false"
    })
    @POST("register")
    Observable<ApiResult<String>> register(@Body AccountRequestBody accountRequestBody);

    /**
     * 登录
     *
     * @param accountRequestBody
     * @return
     */
    @Headers({
            "needToken:false"
    })
    @POST("login")
    Observable<ApiResult<LoginResponseBody>> login(@Body AccountRequestBody accountRequestBody);

    /**
     * 获取工人列表
     *
     * @return
     */
    @Headers({
            "needToken:true"
    })
    @GET("m/worker/list")
    Observable<ApiResult<WorkerListResponseBody>> getWorkerList();

    /**
     * 录入工序
     *
     * @param processRequestBody
     * @return
     */
    @Headers({
            "needToken:true"
    })
    @POST("m/trace")
    Observable<ApiResult<ProcessResponseBody>> trace(@Body ProcessRequestBody processRequestBody);

    /**
     * 特殊的三种工序 录入工序
     *
     * @param body
     * @return
     */
    @Headers({
            "needToken:true"
    })
    @POST("m/trace/upload")
    Observable<ApiResult<ProcessResponseBody>> traceUpload(@Body RequestBody body);

    /**
     * 工序检测
     *
     * @param processRequestBody
     * @return
     */
    @Headers({
            "needToken:true"
    })
    @POST("m/trace/check")
    Observable<ApiResult<ProcessResponseBody>> check(@Body ProcessRequestBody processRequestBody);

}
